import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';
import { AlertFilled } from '@vicons/antd';
import { renderIcon } from '@/utils/index';

const routeName = 'device';

const routes: Array<RouteRecordRaw> = [
  {
    path: `/${routeName}`,
    name: routeName,
    redirect: `/${routeName}/index`,
    component: Layout,
    meta: {
      title: '设备监控',
      sort: 2,
    },
    children: [
      {
        path: 'index',
        name: `${routeName}_index_1`,
        meta: {
          title: '测试页面1',
          icon: renderIcon(AlertFilled),
        },
        component: () => import('@/views/test/index.vue'),
      },
      {
        path: 'index_2',
        name: `${routeName}_index_2`,
        meta: {
          title: '测试页面2',
          icon: renderIcon(AlertFilled),
        },
        component: () => import('@/views/test/index.vue'),
      },
    ],
  },
];

export default routes;
